<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"                
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:r="http://java.sun.com/jsf/composite/rumus"
                template="../../modelo/padrao.xhtml">
                                
                
    <ui:define name="titulo">#{i18n['bairro.titulo.listar']}</ui:define>                
    <ui:define name="conteudo">
    	<h:form id="formListar" prependId="false">
			<r:barraListar bean="#{listarBairro}"  disativarPesquisar="#{!p:ifGranted('CADASTRO_BAIRRO_PESQUISAR')}" disativarIncluir="#{!p:ifGranted('CADASTRO_BAIRRO_INCLUIR')}">
				<h:panelGrid columns="2">
			    	<h:outputLabel>#{i18n['bairro.nome']}</h:outputLabel>			    	
			    	<h:outputLabel>#{i18n['bairro.municipio']}</h:outputLabel>
			    	<p:inputText value="#{listarBairro.objeto.nome}" size="50"/>			    	
			    	<h:selectOneMenu id="cbMunicipio">
			    		<f:selectItem itemLabel="Selecione" itemValue=""/>
			    		<f:selectItems value="#{listarMunicipio.objeto.nome}"/>
			    	</h:selectOneMenu>
		    	</h:panelGrid>
			</r:barraListar>
			<br/>	
			<r:tabela id="grade" bean="#{listarBairro}" outcome="#{'/cadastro/bairro/'}" >
	    		<p:column>
                	<f:facet name="header">#{i18n['bairro.nome']}</f:facet>
                    <h:outputText value="#{objeto.nome}" />
                </p:column>               
                <p:column style="width:150px">
                	<f:facet name="header">#{i18n['bairro.municipio']}</f:facet>
                    <h:outputText value="#{objeto.municipio}" />
                </p:column>
	    	</r:tabela>
    	</h:form>	
    </ui:define>    
</ui:composition>